<template>
  <div
    class="car-alarm-wrapper d-flex jc-around ai-start"
    :class="cardData.isSelect ? 'active' : ''"
  >
    <MyImage
      width="120px"
      height="120px"
      :src="cardData.snap_path"
      type="non_vehicle"
    />
    <div class="content flex-1 d-flex flex-column jc-center ai-start ml-20">
      <div>{{ $t("channelName") }}: {{ cardData.camera_name }}</div>
      <div>{{ $t("captureDate") }}: {{ cardData.trigger_time }}</div>
    </div>
    <div class="alarm-info">
      {{ (cardData.events_type || cardData.alarm_type) | formatEventsType }}
    </div>
  </div>
</template>

<script>
export default {
  props: {
    cardData: {
      type: Object,
      default: () => {
        return {};
      },
    },
  },
};
</script>

<style lang="less" scoped>
.car-alarm-wrapper {
  box-shadow: 0px 8px 16px 0px rgba(191, 204, 255, 0.2);
  background-color: rgba(255, 255, 255, 1);
  border-radius: 8px;
  border: 1px solid rgba(230, 237, 242, 1);
  width: 290px;
  height: 250px;
  position: relative;
  padding: 10px;
  border-radius: 8px;
  &.active {
    border: 1px solid #09c7aa;
  }
  .content {
    height: 100%;
  }
  .alarm-info {
    position: absolute;
    text-align: center;
    line-height: 29px;
    color: #fff;
    right: 10px;
    top: 10px;
    box-shadow: 0px 6px 12px 0px rgba(255, 136, 0, 0.101961);
    background-image: linear-gradient(
      315deg,
      rgba(255, 136, 0, 1) 0,
      rgba(252, 183, 80, 1) 100%
    );
    border-radius: 0px 10px 0px 0px;
    height: 29px;
    width: 114px;
  }
}
</style>
